package models

type Menu struct {
	Title string `json:"title"`
	Subs  []Menu `json:"subs,omitempty"`
}

func GetAdminMenu(roleType string, id int) []Menu {
	menus := make([]Menu, 0)
	menu1 := Menu{
		Title: "驾校信息",
		Subs: []Menu{
			{
				Title: "驾校信息",
				Subs:  nil,
			}, {
				Title: "教练管理",
				Subs:  nil,
			}, {
				Title: "车辆管理",
				Subs:  nil,
			}, {
				Title: "终端管理",
				Subs:  nil,
			}, {
				Title: "版本升级",
				Subs:  nil,
			},
		},
	}
	menu2 := Menu{
		Title: "学员学时",
		Subs: []Menu{
			{
				Title: "学员学时",
				Subs:  nil,
			}, {
				Title: "学时管理",
				Subs:  nil,
			}, {
				Title: "阶段管理",
				Subs:  nil,
			}, {
				Title: "删除列表",
				Subs:  nil,
			}, {
				Title: "异常学时",
				Subs:  nil,
			},
		},
	}
	menus = append(menus, menu1)
	menus = append(menus, menu2)
	//menus = append(menus, menu3)
	if roleType == "4" { //管理员
		menu4 := Menu{
			Title: "投诉管理",
			Subs: []Menu{
				{
					Title: "添加投诉",
					Subs:  nil,
				}, {
					Title: "投诉列表",
					Subs:  nil,
				}, {
					Title: "问题记录",
					Subs:  nil,
				}, {
					Title: "记录日志",
					Subs:  nil,
				},
			},
		}
		menus = append(menus, menu4)
		var subs5 []Menu
		if id == 19 {
			subs5 = []Menu{
				{
					Title: "添加名额",
					Subs:  nil,
				}, {
					Title: "账单管理",
					Subs:  nil,
				},
				{
					Title: "添加学员账单",
					Subs:  nil,
				},
			}
		} else {
			subs5 = []Menu{
				{
					Title: "添加学员账单",
					Subs:  nil,
				},
			}
		}

		menu5 := Menu{
			Title: "添加名额",
			Subs:  subs5,
		}
		menus = append(menus, menu5)
	} else if roleType == "3" { //用户账号
		menu4 := Menu{
			Title: "问题记录",
			Subs: []Menu{
				{
					Title: "问题记录",
					Subs:  nil,
				}, {
					Title: "记录日志",
					Subs:  nil,
				}, {
					Title: "投诉列表",
					Subs:  nil,
				},
			},
		}
		menus = append(menus, menu4)
	}

	return menus
}

func GetNormalMenu() []Menu {
	menus := make([]Menu, 0)
	menu3 := Menu{
		Title: "学员统计",
		Subs:  nil,
	}
	menu2 := Menu{
		Title: "账单查询",
		Subs:  nil,
	}
	var menu4 = Menu{
		Title: "日志查询",
		Subs:  nil,
	} // menus = append(menus, menu1)
	menus = append(menus, menu3)
	menus = append(menus, menu2)
	menus = append(menus, menu4)

	return menus
}

func GetUserMenu() []Menu {
	menus := make([]Menu, 0)
	menu1 := Menu{
		Title: "未备案学时",
		Subs:  nil,
	}
	menus = append(menus, menu1)
	//menus = append(menus, menu4)

	return menus
}

func GetBrushMenu() []Menu {
	menus := make([]Menu, 0)
	menu1 := Menu{
		Title: "未备案学时",
		Subs:  nil,
	}
	menus = append(menus, menu1)

	return menus
}
